import copy

li = ['qwe', 'zxc', [1, 2, 'asd'], 99]
print('addr(li  )={}, addr(li  [2])={}'.format(hex(id(li)), hex(id(li[2]))))
# 赋值 != ShallowCopy or DeepCopy
liEx = li
print('addr(liEx)={}, addr(liEx[2])={}'.format(hex(id(liEx)), hex(id(liEx[2]))))

# ShallowCopy
li1 = li.copy()
print('addr(li1 )={}, addr(li1 [2])={}'.format(hex(id(li1)), hex(id(li1[2]))))
li2 = copy.copy(li)
print('addr(li2 )={}, addr(li2 [2])={}'.format(hex(id(li2)), hex(id(li2[2]))))

# DeepCopy
li3 = copy.deepcopy(li)
print('addr(li3 )={}, addr(li3 [2])={}'.format(hex(id(li3)), hex(id(li3[2]))))

# add
# 切片属于ShallowCopy
